#ifndef __PLAY_AVI_H__
#define __PLAY_AVI_H__

#include <pthread.h>

#include <libmedia/decode/ffmpeg_video_decoder.h>
#include <libmedia/media_demuxing.h>
#include <libmedia/media_packet.h>

#include <utils/avilib.h>

#include "media.h"


struct avi {
    avi_t* avi_reader;
};

struct play_avi {
    struct media_demuxing_param demuxing_param;
    struct media_demuxing* video_demux;
    struct avi avi;

    pthread_rwlock_t rw_lock;
};

extern struct media_demuxing* media_play_open(const char* dir, const char* name);
extern struct media_packet* media_play_read_pkt(void);
extern void media_play_close(void);
#endif
